//
//  ZZBasicViewController.m
//  Project two framework
//
//  Created by 张峥 on 16/7/21.
//  Copyright © 2016年 张峥. All rights reserved.
//

#import "ZZBasicViewController.h"

@interface ZZBasicViewController ()
@property (nonatomic ,strong) UIView        *goShopView;
@end

@implementation ZZBasicViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
}


- (void)loadDataSource{
    
}

- (void)stepUI{
    
}

- (void)creatAlectControllerTitle:(NSString *)title message:(NSString *)message oneTitle:(NSString *)alertTitle twoTitle:(NSString *)twoTitle{
    //初始化弹出框
    UIAlertController *alertC = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
    if (alertTitle != nil) {
        UIAlertAction *alertOne = [UIAlertAction actionWithTitle:alertTitle style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        }];
        [alertC addAction:alertOne];
    }
    if (twoTitle != nil) {
    UIAlertAction *alertTwo = [UIAlertAction actionWithTitle:twoTitle style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
        [self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
    }];
        [alertC addAction:alertTwo];
    }
    
    [self presentViewController:alertC animated:YES completion:nil];
    
}

- (NSDate *)stringWithDate:(NSString *)timeStr{
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    formatter.dateFormat = @"yyyy-MM-dd";
    NSDate *date = [formatter dateFromString:timeStr];
    date = [self localeDate:date];
    return date;
}
//解决string转换date少八小时
- (NSDate *)localeDate:(NSDate *)date
{
    NSTimeZone *zone = [NSTimeZone systemTimeZone];
    NSInteger interval = [zone secondsFromGMTForDate: date];
    NSDate *localeDate = [date dateByAddingTimeInterval: interval];
    return localeDate;
}

- (NSTimeInterval)timeWithDate:(NSDate *)date{
    NSTimeInterval time = [date timeIntervalSince1970];
    return time;
}

@end
